<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let name = "老王"
        let tit = "标题内容"
        let [a,b] = [3,5];

        function fn(){
            return 888;
        }
        // ES5 字符串拼接
        let str2 ="<div>"
            str2+= "<div>"+fn()+"</div>"
            str2+=   " <p title='"+tit+"'>"+name+"求和"+(a-b)+"</p>"    
            str2+= "</div>";
        console.log(str2);

        // ES6模版字符串
        let str = `
            <div>
                <div>${fn()}</div>
                <h3 title="${tit}">${name}</h3>
                <p>${a+b}</p>
            </div>
        `;
        console.log(str);

        

    </script>
</body>
</html>